Skip to content

Conversation

@kesslerio
Copy link

This fixes a few generator issues I hit while testing with Calendly’s OpenAPI spec.

What changed

  • Safe string literals in generated Click options

    • switched help/default emission to Python literals (repr(...)) via helper properties
    • avoids syntax breakage from multiline/quoted descriptions
  • Auth header block no longer generates invalid empty branch

    • added api_key_header_name and explicit fallback behavior
    • if API key header is defined, use it; otherwise fallback to X-API-Key
  • Param mapping now uses OpenAPI metadata

    • added location + api_name to CLIOption
    • route by location (path, query, body, body_raw) instead of string heuristics
    • preserves names like min_start_time, invitee_email, and path params like uuid
  • Text cleanup for generated docs/help

    • normalize whitespace for safer emitted strings

Tests added

  • quoted/multiline help text compiles correctly
  • path/query mapping uses OpenAPI names (not transformed CLI flag names)

Local test result: 39 passed

Also validated by regenerating Calendly CLI and running:

  • root --help
  • nested command help (scheduled-events get-events --help)

Fixes #1

Cheers, Art

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendly spec breaks generated CLI (string escaping + auth block + param mapping)

2 participants